home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 9051 < prev    next >
Encoding:
Text File  |  1996-08-05  |  1.9 KB  |  42 lines

  1. Path: solon.com!not-for-mail
  2. From: seebs@solutions.solon.com (Peter Seebach)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: Schildt <- Advanced Books
  5. Date: 7 Mar 1996 19:48:51 -0600
  6. Organization: Usenet Fact Police (Undercover)
  7. Message-ID: <4ho3m3$iov@solutions.solon.com>
  8. References: <8BA8405.02C70020DE.uuout@sourcebbs.com> <danpop.826121528@rscernix> <4hleu9$5ah@solutions.solon.com> <danpop.826238706@rscernix>
  9. NNTP-Posting-Host: solutions.solon.com
  10.  
  11. In article <danpop.826238706@rscernix>, Dan Pop <danpop@mail.cern.ch> wrote:
  12. >In <4hleu9$5ah@solutions.solon.com> seebs@solutions.solon.com (Peter Seebach) writes:
  13. >>I consider a bug subtle if the code is likely to work correctly most of the
  14. >>time.
  15.  
  16. >So, you consider "void main" and calling malloc without a declaration in
  17. >scope subtle bugs :-)
  18.  
  19. Yup.  They are not obvious to a casual programmer who hasn't specifically
  20. been warned about them.  The latter especially; if you're looking at
  21. code in the middle of a 500+ line module, how often do you remember to
  22. check for relevant headers?  :)
  23.  
  24. I consider subtle bugs somewhat worse than obvious ones in a programming
  25. text.  For instance, an O'Reilly book I'm using right now (a 1992 edition,
  26. so this is probably fixed) consistently, in code examples, spells the
  27. operator which compares for equality as "=^=".  I assume this is a typesetting
  28. artifact.  It is a harmless thing; no one will be misled, I suspect.
  29.  
  30. The same book, at one point, declares
  31.     char *buf[128];
  32. and passes the buffer to something like fgets().  I consider this much more
  33. serious; it is likely to slip into real code, and will not even produce a
  34. warning on certain oft-used and broken systems, like Sun's.
  35.  
  36. -s
  37. -- 
  38. Peter Seebach - seebs@solon.com - Copyright 1996 Peter Seebach.
  39. C/Unix wizard -- C/Unix questions? Send mail for help.  No, really!
  40. FUCK the communications decency act.  Goddamned government.  [literally.]
  41. The *other* C FAQ - http://www.solon.com/~seebs/c/c-iaq.html
  42.